package com.its.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author huguangjun
 * @className ApplicationConfig
 * @date 2021/1/8
 * @desc 11:00
 */
@Configuration
public class ApplicationConfig {

    @Bean
    //负载均衡（默认轮询）
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
